pe = new (require('pretty-error'))()

module.exports = (app) ->
    app.on(
        'error'
        (err, ctx) =>
            txt = pe.render(err)
            console.error txt.split("\n").reverse().join("\n")

    )
